package com.owenobyrne.btce;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.owenobyrne.btce.api.model.BterInfo;

public class TestAPI {
	static final Logger logger = Logger.getLogger(TestAPI.class.getName());
	static ApplicationContext context;
	static BTCE btce;
	static Map<String, BterInfo> bterMap = new HashMap<String, BterInfo>();

	static Map<String, Integer> flag = new HashMap<String, Integer>();
	static {

		context = new ClassPathXmlApplicationContext("beans.xml");
		btce = (BTCE) context.getBean("BTCE");
	}

	public static void main(String[] args) {
		System.setProperty("javax.net.ssl.trustStore",
				"D:\\work\\btc-e-api-master\\jssecacerts");

		while (true) {
			try {
				btce.execute();
			} catch (Exception e) {
				for (int i = 0; i < 5; i++) {
					try {
						btce.execute();

					} catch (Exception e2) {
						// TODO: handle exception
					}
					try {
						Thread.sleep(100);
					} catch (InterruptedException e1) {
						// TODO Auto-generated catch block
						e1.printStackTrace();
					}
				}

			}
		}
	}

}
